<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>商品管理</title>
	<link href="/css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div class="place">
    	<span>位置：</span>
	    <ul class="placeul"><li><a href="/index.html">首页</a></li><li>商品管理</li></ul>
    </div>
    
    <div class="rightinfo">
	    <div class="tools">
	    	<ul class="toolbar">
		        <li class="click"><a href="/ware/info/add.html"><span><img src="/images/t01.png" /></span>添加商品</a></li>
		        <li id="delBatch"><span><img src="/images/t03.png" /></span>批量删除</li>
	        </ul>
	        <ul class="toolbar1">
	        	<form action="/ware/info/infos.html" method="post">
		        	<span>
				    	<select class="select3" name="brandId" style="width: 200px;" <#if op?? && op="view">disabled=true</#if>>
						    <option value="">选择品牌</option>
						    <#if brandAll??><#list brandAll as item>
						    <option value=${item.id} <#if (info.brandId)?? && (info.brandId)?number == item.id>selected="selected"</#if>>${item.name}</option>
						    </#list></#if>
					    </select>
				    	<select class="select3" name="catId" style="width: 200px;" <#if op?? && op="view">disabled=true</#if>>
						    <option value="">选择所属分类</option>
						    <#if categoryAll??><#list categoryAll as item>
						    <option value=${item.id} <#if (info.catId)?? && (info.catId)?number == item.id>selected="selected"</#if>>${item.name}</option>
						    </#list></#if>
					    </select>
					    <input name="barcode" class="scinput" type="text" value="${(info.barcode)!""}" autocomplete="off" placeholder="商品条码">
		        		<input name="code" class="scinput" type="text" value="${(info.code)!""}" autocomplete="off" placeholder="商品货号">
		        		<input name="name" class="scinput" type="text" value="${(info.name)!""}" autocomplete="off" placeholder="商品名称">
				    	<input type="submit" class="scbtn" value="查询"/>
		        	</span>
	    		</form>
	        </ul>
	    </div>
        
    	<table class="tablelist">
	    	<thead>
		    	<tr>
			        <th width="3%"><input  type="checkbox" class="check_box" id="allChk"></input></th>
			        <th width="5%">ID</th>
			        <th width="7%">商品图</th>
			        <th width="12%">商品名称</th>
			        <th width="10%">商品状态</th>
			        <th width="8%">品牌分类</th>
			        <th width="15%">价格积分</th>
			        <th width="10%">库存数量</th>
			        <th width="18%">生产信息</th>
			        <th width="12%">操作</th>
		        </tr>
	        </thead>
	        <tbody>
	        <#if infos??>
			  		<#list infos as item>
						<tr id="ware_tr_${(item.id)!0}">
					        <td><input type="checkbox" class="check_box" name="colChk" value=${(item.id)!0}></input></td>
					        <td>${(item.id)!0}</td>
					        <td><a href="/ware/info/view/${item.id}.html"><img src="${(item.imageMain)!"/images/no_pic.png"}" width="70px"></img></a></td>
					        <td id="ware_name_${(item.id)!0}">
					       	 	<p><a href="/ware/info/view/${item.id}.html">${(item.name)!""}</a></p>
					        	<p>货号：${(item.code)!"--"}</p>
					        	<p>条码：${(item.barcode)!"--"}</p>
					        </td>
					        <td>
					        	<p>
					        	<i id="ware_status_${(item.id)!0}" style="font-size:14px; font-weight: bolder;">
					        	<#if ((item.status)!1)?number = 1>草稿<#elseif ((item.status)!1)?number == 2>下架<#elseif ((item.status)!1)?number == 3>在售<#elseif ((item.status)!1)?number == 4>删除</#if>
					        	</i>
					        	<i id="ware_hot_${(item.id)!0}" style="font-size:14px; font-weight: bolder;">&emsp;&emsp;
					        	<#if ((item.hot)!0)?number = 1>热卖商品</#if>
					        	</i>
					        	</p>
					        	<#if item.lastShelfTime??>
					        	<p>最后上/下架时间：</p>
					        	<p>
					        	<i id="ware_shelfTime_${(item.id)!0}">
					        	${(item.lastShelfTime)?datetime}
					        	</i>
					        	</#if></p>
					        </td>
					        <td>
					        	<p>分类：${(item.categoryName)!"--"}</p>
					        	<p>品牌：${(item.brandName)!"--"}</p>
					        </td>
					        <td>
					        	<p>优惠价：<i id="ware_pricePromotional_${(item.id)!0}">${(item.pricePromotional)!"--"}</i>&ensp;元</p>
					        	<p>市场价：<i id="ware_priceOriginal_${(item.id)!0}">${(item.priceOriginal)!"--"}</i>&ensp;元</p>
					        	<p>积&emsp;分：<i id="ware_score_${(item.id)!0}">${(item.scoreBuy)!0} + ${(item.scorePromote)!0} = ${(item.scoreTotal)!0}</i>分</p>
					        </td>
					        <td>
						        <p>库存：<i id="ware_number_${(item.id)!0}">${(item.numberInventory)!0}</i>&ensp;${(item.unitName)!"--"}</p>
					        	<p>规格：${(item.specifications)!"--"}</p>
					        </td>
					        <td>
					        	<p>生产日期：<#if item.dateManufacture??>${(item.dateManufacture)?date}<#else>--</#if></p>
					        	<p>保&ensp;质&ensp;期：${(item.shelfLife)!"--"}</p>
					        	<p>生产厂家：${(item.manufacturer)!"--"}</p>
					        </td>
					        <td>
					        	<p>
						        	<a href="javascript:void(0);" name="numberInventoryBtn" dataId=${(item.id)!0}>修改库存</a>&ensp;|&ensp;
						        	<a href="javascript:void(0);" name="priceBtn" dataId=${(item.id)!0}>修改价格</a>
					        	</p>
					        	<p><#if ((item.status)!1)?number = 1 || ((item.status)!1)?number = 2>
					        		<a href="javascript:void(0);" name="onShelfBtn" dataId=${(item.id)!0} ">上架</a>&ensp;|&ensp;
					        		<a href="javascript:void(0);" name="deleteBtn" dataId=${(item.id)!0} ">删除</a>
					        		<#elseif ((item.status)!1)?number = 3><a href="javascript:void(0);" name="offShelfBtn" dataId=${(item.id)!0} ">下架</a></#if>
					        	</p>
					        	<p>
						        	<a href="/ware/info/view/${item.id}.html">查看</a>&ensp;|&ensp;
						        	<a href="/ware/info/edit/${item.id}.html">编辑</a>&ensp;|&ensp;
						        	<a href="/ware/info/copy/${item.id}.html">复制</a>
					        	</p>
					        </td>
				        </tr> 
			  		</#list>
			  	</#if>
	        </tbody>
	    </table>
   		<#import "/common/pager.ftl" as page>
		<#if count??>
			<@page.pager start=start size=size count=count url="/ware/info/infos.html?t=admin" gotoPage=true />
		</#if>
	</div>
	
	<!-- 以下为弹出层 -->
	<!-- 数据编辑弹出层，全部逻辑放一起处理了，根据不同操作来显示 -->
	<div class="tip width-320" id="tipDiv">
		<div class="tiptop"><span id="tipTitie">修改价格</span><a></a></div>
		<div class="tipinfo2">
	    	<input id="wareId" name="id" type="hidden" />
	    	<input id="opType" type="hidden" />
		    <ul class="forminfo">
			    <li class="contentWapper" name="confirmLi">
			    	<img src="/images/warning_72px.png" class="tip-confim-img" ></img>
	    			<span class="tip-confim-text"></span>
			    </li>
			    <li class="contentWapper" name="numberInventoryLi">
			    	<label>库存数量：</label>
			    	<input id="numberInventory" type="text" class="dfinput" />&ensp;件
			    </li>
			    <li class="contentWapper" name="priceLi">
			    	<label>优&ensp;惠&ensp;价：</label>
			    	<input id="pricePromotional" type="text" class="dfinput" value="" />&ensp;元
			    </li>
			    <li class="contentWapper" name="priceLi">
			    	<label>积&emsp;&emsp;分：</label>
			    	<input id="score" type="text" class="dfinput" value="" />&ensp;分
			    </li>
			    <li class="contentWapper" name="priceLi">
			    	<label>市&ensp;场&ensp;价：</label>
			    	<input id="priceOriginal" type="text" class="dfinput" value="" />&ensp;元
			    </li>
			    <li>
			    	<label>&nbsp;</label>
			    	<input id="submitBtn" type="button" class="btn-blue" value="确认"/>&nbsp;&nbsp;
			    	<input id="closeBtn" type="button" class="btn-blue" value="关闭"/>
			    </li>
		    </ul>
        </div>
    </div>
</body>
<script type="text/javascript" src="/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="/js/commonList.js"></script>
<script type="text/javascript" src="/js/biz/wareInfos.js"></script>
<script type="text/javascript">
	/** 删除的URL地址前缀，在commonList.js里面调用的删除方法会用到 */
	var delUrl = "/ware/info";
</script>
	
</html>